<template>
  <van-cell class="text-item">
    <div slot="title">{{text.title}}</div>
    <div slot="label">
      <div class="cover-wrap" v-if="text.cover.type === 3">
        <div class="cover-item" v-for="(img, index) in text.cover.images"
            :key="index">
          <van-image
            fit="cover"
            class="cover-img"
            :src="img"/>
        </div>
      </div>
      <div class="labelText">
        <span>{{text.aut_name}}</span>
        <span>{{text.comm_count}}</span>
        <span>{{text.pubdate | relativeTime}}</span>
      </div>
    </div>
    <van-image
      v-if="text.cover.type === 1"
      class="right-cover"
      round
      fit="cover"
      :src="text.cover.images[0]"/>
  </van-cell>
</template>

<script>
export default {
  props: {
    text: {
      type: Object,
      require: true
    }
  }
}
</script>

<style lang="less" scoped>
.text-item {
  .van-cell__title {
    font-size: 32px;
    color: #3a3a3a;
  }

  .van-cell__value {
    flex: unset;
    width: 160px;
    height: 160px;
    padding-left: 25px;
    .right-cover {
      width: 160px;
      height: 160px;
    }
  }
  .cover-wrap {
    display: flex;
    padding: 30px 0;
    .cover-item {
      flex: 1;
      height: 146px;
      &:not(:last-child) {
        padding-right: 4px;
      }
      .cover-img {
        width: 100%;
        height: 146px;
      }
    }
  }
  .labelText span {
    margin-right: 25px;
    font-size: 22px;
    color: #b4b4b4;
  }
}
</style>
